Socket
Socket
Sign inDemoInstall

@turf/clone

Package Overview
Dependencies
Maintainers
9
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/clone

turf clone module


Version published
Weekly downloads
832K
decreased by-13.55%
Maintainers
9
Weekly downloads
 
Created

What is @turf/clone?

@turf/clone is a module within the Turf.js library that allows you to create deep copies of GeoJSON objects. This is particularly useful when you need to manipulate or transform GeoJSON data without altering the original dataset.

What are @turf/clone's main functionalities?

Clone a Point

This feature allows you to clone a GeoJSON Point object. The code sample demonstrates how to create a point and then clone it using the @turf/clone module.

const turf = require('@turf/turf');
const point = turf.point([0, 0]);
const clonedPoint = turf.clone(point);
console.log(clonedPoint);

Clone a Polygon

This feature allows you to clone a GeoJSON Polygon object. The code sample demonstrates how to create a polygon and then clone it using the @turf/clone module.

const turf = require('@turf/turf');
const polygon = turf.polygon([[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]);
const clonedPolygon = turf.clone(polygon);
console.log(clonedPolygon);

Clone a Feature Collection

This feature allows you to clone a GeoJSON Feature Collection. The code sample demonstrates how to create a feature collection and then clone it using the @turf/clone module.

const turf = require('@turf/turf');
const featureCollection = turf.featureCollection([turf.point([0, 0]), turf.point([1, 1])]);
const clonedFeatureCollection = turf.clone(featureCollection);
console.log(clonedFeatureCollection);

Other packages similar to @turf/clone

Keywords

FAQs

Package last updated on 09 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc